Homework added#6
Open
Ksenia2102 wants to merge 1 commit intolearnpythonru:masterfrom
Ksenia2102:master
Open
Conversation
alexandrettio
suggested changes
Feb 24, 2021
alexandrettio
left a comment
There was a problem hiding this comment.
Исправить важно только подсчет мальчиков и девочек. Остальное здорово!
| delta_30days = datetime.timedelta(days=30) | ||
|
|
||
| yesterday = dt_now - delta | ||
| today = datetime.datetime.today() |
There was a problem hiding this comment.
Эта строчка дублирует 14ую. Можно не исправлять
| new_content = content.replace('.', '!') | ||
|
|
||
| with open('referat2.txt', 'w', encoding='utf-8') as new_essay: | ||
| new_essay.write(new_content) |
| writer.writeheader() | ||
|
|
||
| for user in user_info: | ||
| writer.writerow(user) |
| # all_names.append(name['first_name']) | ||
|
|
||
| # common_name = collections.Counter(all_names).most_common(1) | ||
| # print(f'Самое частое имя среди учеников: {common_name[0][0]}') |
There was a problem hiding this comment.
в таком месте лучше не делать [0][0] а распаковать
most_common = common_name[0]
name, amount = most_common
| # girls += 1 | ||
| # return girls | ||
|
|
||
| # def count_boys_in_class(clas, names_info): |
There was a problem hiding this comment.
Лучше объединить подсчет мальчиков и девочек в одну функцию и возвращать
return boys, girls
Эту правку лучше сделать для практики
| ] | ||
|
|
||
| i = 1 | ||
| for group in groups: |
There was a problem hiding this comment.
Тут можно использовать enumerate() в остальном в этом файле всё ок
| total_len_words += len(word) | ||
|
|
||
| average_len = total_len_words / len(sentence.split()) | ||
| print(average_len) No newline at end of file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.